/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nms.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author mohamedemara
 */
@Embeddable
public class IspProviderPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "isp_id")
    private String ispId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "provider_name")
    private String providerName;

    public IspProviderPK() {
    }

    public IspProviderPK(String ispId, String providerName) {
        this.ispId = ispId;
        this.providerName = providerName;
    }

    public String getIspId() {
        return ispId;
    }

    public void setIspId(String ispId) {
        this.ispId = ispId;
    }

    public String getProviderName() {
        return providerName;
    }

    public void setProviderName(String providerName) {
        this.providerName = providerName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ispId != null ? ispId.hashCode() : 0);
        hash += (providerName != null ? providerName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IspProviderPK)) {
            return false;
        }
        IspProviderPK other = (IspProviderPK) object;
        if ((this.ispId == null && other.ispId != null) || (this.ispId != null && !this.ispId.equals(other.ispId))) {
            return false;
        }
        if ((this.providerName == null && other.providerName != null) || (this.providerName != null && !this.providerName.equals(other.providerName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.nms.entities.IspProviderPK[ ispId=" + ispId + ", providerName=" + providerName + " ]";
    }
    
}
